package com.cool.modules.finance.controller.admin;


import cn.hutool.json.JSONObject;
import com.cool.core.annotation.CoolRestController;
import com.cool.core.base.BaseController;
import com.cool.modules.finance.entity.coin.FinanceCoinEntity;
import com.cool.modules.finance.entity.coin.table.FinanceCoinEntityTableDef;
import com.cool.modules.finance.service.coin.FinanceCoinService;
import com.mybatisflex.core.query.QueryWrapper;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.servlet.http.HttpServletRequest;

@Tag(name = "币种管理", description = "币种管理")
@CoolRestController(api = { "add", "delete", "update", "list","page" })
public class AdminFinanceCoinController extends BaseController<FinanceCoinService, FinanceCoinEntity> {
    @Override
    protected void init(HttpServletRequest request, JSONObject requestParams) {
        setPageOption(createOp().keyWordLikeFields(FinanceCoinEntityTableDef.FINANCE_COIN_ENTITY.COIN_NAME,FinanceCoinEntityTableDef.FINANCE_COIN_ENTITY.COIN_CODE));
        setListOption(createOp().queryWrapper(new QueryWrapper().orderBy(FinanceCoinEntity::getHotOrder,false)));
    }
}
